package com.example.booklist.enums;

public enum StatusEnum {

    DELETE(0,"删除"),
    NORMAL(1,"可借阅"),
    FORBIDDEN(2,"不可借阅");

    public static StatusEnum getStatusByCode(Integer code) {
        switch (code) {
            case 0: return DELETE;
            case 1: return NORMAL;
            case 2: return FORBIDDEN;
            default: return FORBIDDEN;
        }
    }
    private Integer code;
    private String statusCN;

    StatusEnum(Integer code, String statusCN) {
        this.code = code;
        this.statusCN = statusCN;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getStatusCN() {
        return statusCN;
    }

    public void setStatusCN(String statusCN) {
        this.statusCN = statusCN;
    }
}
